<template>
  <MainLayout title="任务记录">
    <view class="section">
      <view v-if="!list.length" class="empty">暂无历史记录</view>
      <view v-for="t in list" :key="t.id" class="item">
        <view class="title">{{ t.title }}</view>
        <view class="meta">{{ t.project }} · 完成于 {{ t.finishedAt }}</view>
      </view>
    </view>
  </MainLayout>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import MainLayout from '@/layouts/MainLayout.vue'
const list = ref<any[]>([])
onMounted(()=>{
  list.value = [
    { id: 1, title: '模板安装检验', project: '示例项目A', finishedAt: '2025-08-10' },
    { id: 2, title: '钢筋绑扎检验', project: '示例项目B', finishedAt: '2025-08-12' }
  ]
})
</script>

<style scoped>
.section{ padding: 24rpx; }
.item{ background:#fff; padding: 24rpx; border-radius: 12rpx; margin-bottom: 16rpx; }
.title{ font-weight: 700; }
.meta{ color:#888; font-size: 24rpx; margin-top: 6rpx; }
.empty{ color:#888; text-align:center; margin-top: 200rpx; }
</style>
